Skip to content

[IMP] project: dispatch tasks based on project roles #4790

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

deneuvillem
Copy link

@deneuvillem deneuvillem commented Jun 4, 2025

In this PR, we add a new feature allowing project tasks to be dispatched automatically based on:

  • The roles we have defined in the tasks of a project template
  • And a role-to-users mapping showing up when creating a new project from a project template

This feature enhances task management by ensuring that tasks are assigned to the appropriate team members according to their roles, improving efficiency and clarity in project execution.

More precisely, we add a new model: 'Project Roles' that we can link to tasks templates (as long as they belong to a project template).
We can link multiples roles to a single task template, and a role can be linked to different tasks too. A menu item for 'Project Roles' has been added.

When creating a new project from a project template, the user can select in the wizard which users are going to be assigned to the task if some roles match.
This mapping is only visible if at least one role has been defined in any task of the project template, and the available roles in that mapping are only the roles defined in those tasks.
If multiple roles match, all the users matching those roles will be assigned to the task. If a task already contains some assignees, they will not be overridden but the matching users will be added to the existing assignees.

task-4700746

@robodoo
Copy link

robodoo commented Jun 4, 2025

This PR targets the un-managed branch odoo-dev/odoo:master-imp-project-templates-kthe, it needs to be retargeted before it can be merged.

@deneuvillem deneuvillem force-pushed the master-project_template_role_dispatch-mane branch 8 times, most recently from 9cc18d8 to 4436b9a Compare June 10, 2025 16:06
@ppr-odoo ppr-odoo force-pushed the master-imp-project-templates-kthe branch 11 times, most recently from 3ed7bdb to d052eef Compare June 14, 2025 12:51
@deneuvillem deneuvillem force-pushed the master-imp-project-templates-kthe branch from d052eef to 4e031e0 Compare June 15, 2025 13:57
@ppr-odoo ppr-odoo force-pushed the master-imp-project-templates-kthe branch 4 times, most recently from 4b99326 to 545cb35 Compare June 16, 2025 13:28
@deneuvillem deneuvillem force-pushed the master-project_template_role_dispatch-mane branch 4 times, most recently from 20b318b to 8ceac8d Compare June 17, 2025 10:37
@deneuvillem deneuvillem force-pushed the master-imp-project-templates-kthe branch from a036c66 to 99f138e Compare June 17, 2025 16:21
@deneuvillem deneuvillem force-pushed the master-imp-project-templates-kthe branch from 99f138e to c9dce2a Compare June 17, 2025 16:23
@ppr-odoo ppr-odoo force-pushed the master-imp-project-templates-kthe branch 2 times, most recently from 912c7c9 to abec25b Compare June 18, 2025 07:26
@deneuvillem deneuvillem force-pushed the master-project_template_role_dispatch-mane branch 3 times, most recently from 0c7c917 to 4ddd285 Compare June 18, 2025 16:29
@ppr-odoo ppr-odoo force-pushed the master-imp-project-templates-kthe branch from 3b57a27 to 04e149d Compare June 19, 2025 05:51
@deneuvillem deneuvillem force-pushed the master-imp-project-templates-kthe branch 2 times, most recently from 8ae6ec1 to 58cda18 Compare June 19, 2025 08:11
@deneuvillem deneuvillem force-pushed the master-project_template_role_dispatch-mane branch 2 times, most recently from 46889cf to 3838953 Compare June 19, 2025 09:59
In this commit, we add a new feature allowing project tasks to be dispatched automatically based on:
- The roles we have defined in the tasks of a project template
- And a role-to-users mapping showing up when creating a new project from a project template

This feature enhances task management by ensuring that tasks are assigned to the appropriate team members according to their roles, improving efficiency and clarity in project execution.

More precisely, we add a new model: 'Project Roles' that we can link to tasks templates (as long as they belong to a project template).
We can link multiples roles to a single task template, and a role can be linked to different tasks too. A menu item for 'Project Roles' has been added.

When creating a new project from a project template, the user can select in the wizard which users are going to be assigned to the task if some roles match.
This mapping is only visible if at least one role has been defined in any task of the project template, and the available roles in that mapping are only the roles defined in those tasks.
If multiple roles match, all the users matching those roles will be assigned to the task. If a task already contains some assignees, they will not be overridden but the matching users will be added to the existing assignees.

task-4700746
@deneuvillem deneuvillem force-pushed the master-project_template_role_dispatch-mane branch from 3838953 to ecd2f8f Compare June 19, 2025 11:28
@xavierbol xavierbol marked this pull request as ready for review June 19, 2025 13:24
@robodoo
Copy link

robodoo commented Jun 19, 2025

This PR targets the un-managed branch odoo-dev/odoo:master-imp-project-templates-kthe, it needs to be retargeted before it can be merged.

@deneuvillem deneuvillem force-pushed the master-project_template_role_dispatch-mane branch from a84bb46 to f0b1264 Compare June 19, 2025 16:23
Before this commit, when creating a new project from a template, the 'partner_id' field
was being removed from the values given to 'action_create_from_template()', even if
it was explicitly set in the 'values' parameters we want the new project to have.
For instance when specifying the 'Customer' field from the project creation from template wizard,
it was not being taken into account, and the new project was created without a partner.
Same when a product is configured to generate a project from a template, the partner was not set
on the new project. We adapt the copy method of project to do so.
We also make projects billable by default and remove some 'default_allow_billable' contexts as it's not useful anymore, and we adapt tests accordingly.
@deneuvillem deneuvillem force-pushed the master-project_template_role_dispatch-mane branch from f0b1264 to 3242e70 Compare June 19, 2025 20:13
@xavierbol xavierbol closed this Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants